package cool.taomu.toolkit.entity

import org.eclipse.xtend.lib.annotations.Accessors
import org.eclipse.xtend.lib.annotations.ToString

@Accessors
@ToString
class ResultsEntity<T> {
	int status;
	String msg;
	T result;

	new(int status) {
		this(status, null, null);
	}

	new(int status, String msg) {
		this(status, msg, null);
	}

	new(int status, String msg, T result) {
		this.status = status;
		this.result = result
	}

	def static _404(String msg) {
		new ResultsEntity(404, msg);
	}

	def static <T> _200(String msg, T result) {
		new ResultsEntity(200, msg, result);
	}

	def static <T> _201(String msg) {
		new ResultsEntity(201, msg);
	}
}
